<!DOCTYPE html>

<!--
   Copyright 2014 Google Inc. All rights reserved.

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->

<html>
<head>
<meta charset="UTF-8">
<title>IO Schedule updater</title>
<link rel="stylesheet" type="text/css" href="index.css"></link>
<style type="text/css">
.body {
  background-color: #dddddd;
}
.app {
 background-color: white;
 box-shadow: 2px 2px 5px rgb(168,168,168);
 margin: 40px auto;
 width: 50%;
 max-width: 800px;
 padding: 40px;
}
.proceed.green:hover {
  background: rgb(0, 107, 17);
}
.proceed.green {
  cursor: pointer;
  background: rgb(0, 160, 25);
  color: white;
}
.proceed {
-webkit-transition: 0.3s all;
margin: 20px auto;
width: 100px;
height: 100px;
border-radius: 50px;
background: rgb(202, 0, 0);
border-color: black;
box-shadow: 5px 5px 15px black;
vertical-align: middle;
text-align: center;
line-height: 100px;
color: transparent;
font-weight: bold;
}
.warning {
  margin: 60px;
}
img {
  width: 200px;
  border-radius: 100px;
  box-shadow: 0px 0px 15px;
    margin-bottom: 30px;
}
.waitingMessage {
  display: none;
}
.waiting .waitingMessage {
  display: block;
}
pre {
  overflow-x: auto;
}
</style>
</head>
<body>
<div class="app">
  <div style="text-align: center;">
    <img src="img/ok_1.jpg">
  </div>
  <div class="warning">
It worked, you totally ROCK!!! Data has been updated from CMS and should be processed and available to the Android app within the next 30 minutes.  
  </div>  
</div>
<div class="app">
<pre class="prettyprint" id="source">
Hold on, downloading updated data...
</pre>
</div>
</body>
<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js&lang=js"></script>
<script>
  document.addEventListener('DOMContentLoaded', function() {
     var xhr = new XMLHttpRequest();
     var url="http://storage.googleapis.com/iosched-updater-dev.appspot.com/__raw_session_data.json";
     xhr.open('GET', url);
     xhr.responseType = 'json';
     xhr.onload = function(ev) {
       var area = document.querySelector('#source');
       area.innerText = JSON.stringify(ev.target.response, null, 2);
     };
     xhr.onerror = function(ev) {
       var area = document.querySelector('#source');
       area.innerText = "Could not load "+url;
     };
     xhr.send();
   });
</script>
</html>
